<!doctype html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
	<script type="text/javascript">

	arr = [34,54,54,54,54,5,5,5,54,5,5,5,5,5,5,5,53,34,34];

	function qc (x) {
		
		for (var i =0; i < arr.length; i++) {
			for (var k = i+1; k < arr.length; k++) {
				if(x[i]==x[k]){
					x.splice(k, 1);
					k--;
				}
			};
		};

		return x;

	}

	res = qc(arr);

	// document.write(res);



	arr = [34,45,4,2,546,4];

		// [546,45,34,4,4,2]

	function msort (newArr) {

		for (var k = 0; k< newArr.length; k++) {
			for (var i = 0; i< newArr.length; i++) {
				
				if(newArr[i]>newArr[i+1]){
					temp = newArr[i+1];
					newArr[i+1]=newArr[i];
					newArr[i]=temp;
				}
			};
		};
		
		return newArr;
	}

	res = msort(arr);

	document.write(res);







	</script>
</head>
<body>
	
</body>
</html>